class MyCarModel {
  int? errcode;
  String? errmsg;
  List<MyCarItemModel>? data;
  String? message;

  MyCarModel({this.errcode, this.errmsg, this.data, this.message});

  MyCarModel.fromJson(Map<String, dynamic> json) {
    errcode = json['errcode'];
    errmsg = json['errmsg'];
    if (json['data'] != null) {
      data = <MyCarItemModel>[];
      json['data'].forEach((v) {
        data!.add(new MyCarItemModel.fromJson(v));
      });
    }
    message = json['message'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errcode'] = this.errcode;
    data['errmsg'] = this.errmsg;
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    data['message'] = this.message;
    return data;
  }
}

class MyCarItemModel {
  int? id;
  String? carName;
  String? carNumber;
  String? carModel;
  String? carType;
  int? applicantId;
  String? applicantName;
  String? placeStart;
  String? placeEnd;
  String? urgency;
  String? approvalStatus;
  String? timeStart;
  String? timeEnd;
  int? userId;
  String? userName;
  String? image;

  MyCarItemModel(
      {this.id,
        this.carName,
        this.carNumber,
        this.carModel,
        this.carType,
        this.applicantId,
        this.applicantName,
        this.placeStart,
        this.placeEnd,
        this.urgency,
        this.approvalStatus,
        this.timeStart,
        this.timeEnd,
        this.userId,
        this.userName,
        this.image});

  MyCarItemModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    carName = json['car_name'];
    carNumber = json['car_number'];
    carModel = json['car_model'];
    carType = json['car_type'];
    applicantId = json['applicant_id'];
    applicantName = json['applicant_name'];
    placeStart = json['place_start'];
    placeEnd = json['place_end'];
    urgency = json['urgency'];
    approvalStatus = json['approval_status'];
    timeStart = json['time_start'];
    timeEnd = json['time_end'];
    userId = json['user_id'];
    userName = json['user_name'];
    image = json['image'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['car_name'] = this.carName;
    data['car_number'] = this.carNumber;
    data['car_model'] = this.carModel;
    data['car_type'] = this.carType;
    data['applicant_id'] = this.applicantId;
    data['applicant_name'] = this.applicantName;
    data['place_start'] = this.placeStart;
    data['place_end'] = this.placeEnd;
    data['urgency'] = this.urgency;
    data['approval_status'] = this.approvalStatus;
    data['time_start'] = this.timeStart;
    data['time_end'] = this.timeEnd;
    data['user_id'] = this.userId;
    data['user_name'] = this.userName;
    data['image'] = this.image;
    return data;
  }
}
